Arduino Interrupts by Norman Dunbar

Arduino Interrupts by Norman Dunbar
Author: Norman Dunbar
Language: eng
Format: epub
ISBN: 9781484297148
Publisher: Apress

8.6.1.1 Transmitting Data


Our code to send data to the USART starts, as always, with a header file. The file is named USARTinterrupt.h, and we will be coming back to it and adding extra code to it as we progress. For data transmission, the code in Listing 8-2 is all that is required. Comments have been mostly removed from the listings.

The eagle-eyed among you will have noticed that I’m including printf.h. Yes, I have a version of the Arduino library that can be used in AVR code. I have made it available on the code repository for this book. In the example sketch, you will find it in the lib/printf directory.

Listing 8-2 USARTinterrupt.h—transmission constants